#include "Rp2MultiTextureEffect.h"

using namespace Rp2;

int MultiTextureEffect::GetTextureNum[4] = 
{
	GL_TEXTURE0,
	GL_TEXTURE1,
	GL_TEXTURE2,
	GL_TEXTURE3
};

//---------------------------------------------------------------------------------------------------
MultiTextureEffect::MultiTextureEffect(int iTextureQuantity)
{
/*
	m_eEffect = SE_MULTIEFFECT;
	m_iTexQuantity = iTextureQuantity;
	memset(m_iTexID, 0, 4 * sizeof(int));
*/
}
//---------------------------------------------------------------------------------------------------
MultiTextureEffect::~MultiTextureEffect()
{
}
//---------------------------------------------------------------------------------------------------
void MultiTextureEffect::SetTexture(int i, const std::string& rkTextureName)
{
/*
	assert(i < m_iTexQuantity);

	int iTexNum = GetTextureNum[i];
	// activate corresponding texture
	glActiveTexture(iTexNum);

	// texture setting
	Tga* tga = new Tga;
	if(!Tga::ReadTGA(rkTextureName.c_str(), tga))
		assert(false);
	if (!tga->GetData())
	{
		assert(false);
	}
	glGenTextures(1, (GLuint*)&m_iTexID[i]);
	glBindTexture(GL_TEXTURE_2D, m_iTexID[i]);

	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);	
	glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
	glTexImage2D(GL_TEXTURE_2D, 0, tga->GetComponent(), tga->GetWidth(), tga->GetHeight(), 0,
		tga->GetFormat(), GL_UNSIGNED_BYTE, tga->GetData());	
	glGenerateMipmap(GL_TEXTURE_2D);	
*/
}
//---------------------------------------------------------------------------------------------------